var qpanel_statisticCheck = new Ext.form.FormPanel({
	id : 'form_query_statisticCheck',
	height : 60,
	region : "north",
	frame : true,
	baseCls : "x-plain",
	style : "padding:5px",
	items : [{
		layout : "column",
		frame : true,
		baseCls : 'x-plain',
		items : [{
			columnWidth : 0.5,
			layout : "form",
			frame : true,
			baseCls : 'x-plain',
			labelAlign : 'right',
			defaults : {
				anchor : '90%',
				width : 200,
				msgTarget : 'side'
			},
			defaultType : 'textfield',
			items : [{
						xtype : 'combo',
						fieldLabel : '<span style="color: red">*&nbsp;</span>考核年度',
						hiddenName : 'year',
						valueField : 'value',
						displayField : 'text',
						value : check_year,
						mode : 'local',
						store : ds_year_select,
						value : select_year,
						selectOnFocus : true,
						editable : false,
						allowBlank : false,
						typeAhead : true,
						readOnly : true,
						triggerAction : 'all',
						loadingText : '加载中...',
						emptyText : '请选择考核年度'
					},{
						id : 'combotree_static_check',
						xtype : 'combotree',
						fieldLabel : '<span style="color: red">*&nbsp;</span>指标目录',
						hiddenName : 'categoryId',
						selectNodeModel:'leaf', //只有选叶子时，才设置值  
						allowBlank : true,
						tree : {
							xtype:'treepanel',
							rootVisible : false,
							autoScroll : true,
							firstLoad : true,
							loadingText : '加载中...',
							loader : new Ext.tree.TreeLoader(),
							root : new Ext.tree.AsyncTreeNode(),
							listeners : {
								'beforeload' : function(node) {
									var frm = Ext.getCmp("form_query_statisticCheck").getForm();
									var	checkYear = frm.findField('year').getValue();
									if(checkYear == null) {
										Ext.MessageBox.alert("请选择年度!");
										return;
									}
									var nodeId = Ext.num(node.id, null);
									if (Ext.isNumber(nodeId)) {
										this.loader.dataUrl = '/supervise/biz/goalcategory/getChildrenById.action?checkYear='
												+ checkYear + '&nodeId=' + node.id;
									} else {
										this.loader.dataUrl = "/supervise/biz/goalcategory/getRoot.action?checkYear=" + checkYear;
									}
								}
							}
				    	},
				    	listeners:{  
				            beforeselect: function(comboxtree,newNode,oldNode){//选择树结点设值之前的事件  
				                 
				            },  
				            select: function(comboxtree,newNode,oldNode){//选择树结点设值之后的事件  
//				                var frm = Ext.getCmp("form_add_goaldetail").getForm();
//				                var percent = newNode.attributes.percent;
//				            	frm.findField('goalDetail.percent').setValue(percent);
//				            	frm.findField('goalDetail.categoryIdPath').setValue(newNode.getPath("id"));
//								frm.findField('goalDetail.categoryNamePath').setValue(newNode.getPath("text"));
				            },  
				            afterchange: function(comboxtree,newNode,oldNode){//选择树结点设值之后，并当新值和旧值不相等时的事件  
				                  //...  
				            }  
				     	}  
					}]
		}, {
			columnWidth : 0.5,
			layout : "form",
			frame : true,
			baseCls : 'x-plain',
			labelAlign : 'right',
			defaults : {
				anchor : '90%',
				width : 200,
				msgTarget : 'side'
			},
			items : [new Ext.form.ComboBox({
						fieldLabel : '单位类型',
						hiddenName : 'orgType',
						allowBlank : false,
						mode : 'local',
						readOnly : true, 
						triggerAction : 'all', 
						anchor : '90%',
						emptyText : '请单位类型',
						store : new Ext.data.SimpleStore({ // 填充的数据
							fields : ["retrunValue", "displayText"],
							data : [['unit', '垂直管理单位'], ['dept', '机关'],
									['town', '乡镇'],
									['project', '工业园区管委会和工程建设指挥部']]
						}),
						valueField : 'retrunValue', // 传送的值
						displayField : 'displayText',
						listeners : {
							'select' : function(combo, record, index) {
								var orgType = combo.getValue();
								try {
									var queryOrg = Ext
											.getCmp('query_progress_orgId');
									queryOrg.clearValue();
									queryOrg.store.reload({
												params : {
													orgType : orgType
												}
											});
								} catch (ex) {
									Ext.MessageBox.alert(ex);
								}
							}
						}
					})]
		}]
	}],
	buttonAlign : 'center',
	minButtonWidth : 60,
	buttons : [{
				text : '查询',
				handler : function(btn) {
				    var panel = panel_statistic_check_content;
					var form = Ext.getCmp("form_query_statisticCheck").getForm();
					panel.getUpdater().update({
						url : '/supervise/biz/statistic/statisticCheck.action',
						params : {
							orgType :form.findField("orgType").getValue(), 
							year :  form.findField("year").getValue()
						},
						update : function(){
						}
					});
		}
			}, {
				text : '重置',
				handler : function() {
					this.ownerCt.ownerCt.getForm().reset();
					// Ext.getCmp('combotree_query_statisticCheck_categoryId').setRawValue('');

				}
			}]
});
var panel_statistic_check_content = new Ext.Panel({
			width : '100%',
			id : 'panel_statistic_check_content',
			autoLoad : {
				url : '/supervise/main/statistic_check_blank.html'
			},
			title : '考核统计',
			region : 'center'
		});
var query_statisticCheck = new Ext.Panel({
			frame : false,
			region : 'center',
			labelWidth : 65,
			title : '社会评价查询',
			labelPad : 45,
			buttonAlign : 'center',
			layout : 'border',
			items : [qpanel_statisticCheck, panel_statistic_check_content]
		});
var p_statisticCheck = {
	id : 'statisticCheck-panel',
	border : false,
	layout : 'border',
	items : [query_statisticCheck]
};
